﻿Public Class BarBouton

    '
    'Initialisation de la barre
    '
    Private Sub BarBouton_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



    End Sub
    '
    'Gestion des boutons de navigation
    '
    Public Event Navigation(ByVal sender As Object, ByVal e As navigationEventArgs)
    Public Event Action(ByVal sender As Object, ByVal e As ActionEventArgs)


    Private Sub BtnPremier_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPremier.Click
        RaiseEvent Navigation(Me, New navigationEventArgs(navigationEnum.Premier))
    End Sub

    Private Sub BtnPrecedent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrecedent.Click
        RaiseEvent Navigation(Me, New navigationEventArgs(navigationEnum.Precedent))
    End Sub

    Private Sub BtnSuivant_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSuivant.Click
        RaiseEvent Navigation(Me, New navigationEventArgs(navigationEnum.Suivant))
    End Sub

    Private Sub BtnDernier_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnDernier.Click
        RaiseEvent Navigation(Me, New navigationEventArgs(navigationEnum.Dernier))
    End Sub

    '
    'Gestion des autres boutons
    '
    Private Sub BtnAjouter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnAjouter.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Ajouter))
        Me.BtnAjouter.Enabled = False
        Me.BtnSupprimer.Enabled = False
    End Sub

    Private Sub BtnEnregistrer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEnregistrer.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Enregistrer))
    End Sub

    Private Sub BtnSupprimer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSupprimer.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Supprimer))
    End Sub

    Private Sub BtnAnnuler_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnAnnuler.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Annuler))
    End Sub

    Private Sub BtnArchivage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnArchivage.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Archiver))
    End Sub

    Private Sub BtnAnimaux_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnAnimaux.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.LienAnimaux))
    End Sub

    Private Sub BtnClients_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnClients.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.LienClient))
    End Sub

    Private Sub BtnDossierMedicaux_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnDossierMedicaux.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.LienDossierMedical))
    End Sub

    Private Sub BtnConsultation_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnConsultation.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.LienConsultation))
    End Sub

    Private Sub BtnImprimer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnImprimer.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Imprimer))
    End Sub

    Private Sub BtnQuitter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnQuitter.Click
        Dim dialogresult As DialogResult = MessageBox.Show("Êtes-vous sûr?", "Quitter la fenêtre", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
        If dialogresult = Windows.Forms.DialogResult.Yes Then
            Me.ParentForm.Close()
        End If
    End Sub

    Private Sub BtnValider_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnValider.Click
        RaiseEvent Action(Me, New ActionEventArgs(actionEnum.Valider))
    End Sub
End Class
